package com.altorithm;

import java.util.Arrays;
import java.util.Collection;
import java.util.List;

/**
 * @Classname Common
 * @Date 2019/9/25 10:18
 * @auther by hqy
 */
public class Common {

    public static void swag(int[] array, int i, int j) {
        int temp = array[i];
        array[i] = array[j];
        array[j] = temp;
    }

    public static void print(int[] array) {
        for (int i = 0; i < array.length; i++) {
            System.out.printf(array[i] + ",");
        }
        System.out.println();
    }

    public static void init(int[] array) {
        for (int i = 0; i < array.length; i++) {
            array[i] = (int) (Math.random() * 1000);
        }
    }

    public static void copyArray(int[] source, int[] destination) {

        for (int i = 0; i < source.length; i++) {
            destination[i] = source[i];
        }

    }
}
